package book;

import operate.Ioperate;

import java.util.Objects;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-23
 * Time: 22:07
 */
public class Books {

    private String name;
    private String writer;
    private int price;
    private boolean borrow;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Books books = (Books) o;
        return this.getName() == ((Books) o).getName();
    }


    public Books(String name, String writer, int price) {
        this.name = name;
        this.writer = writer;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Books{" +
                "name='" + name + '\'' +
                ", writer='" + writer + '\'' +
                ", price=" + price +
                ", borrow=" + (this.borrow == false ? "未借出" : "已借出") + "}";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWriter() {
        return writer;
    }

    public void setWriter(String writer) {
        this.writer = writer;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public boolean isBorrow() {
        return borrow;
    }

    public void setBorrow(boolean borrow) {
        this.borrow = borrow;
    }
}
